<template>
  <div class="side-pic">
    <div class="pic" v-for="(img, index) in imgs" :key="index" @click.stop="preview(index)">
      <img :src="img.url" alt="" />
    </div>
  </div>
</template>

<script>
import { preview } from '@/utils/preview'
export default {
  props: {
    imgs: Array
  },
  methods: {
    preview(index) {
      let imgs = []
      this.imgs.forEach((img) => {
        imgs.push(img.url)
      })
      preview(imgs, index)
    }
  }
}
</script>

<style lang="less" scoped>
.side-pic {
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;

  .pic {
    width: 33%;
    height: 118px;
    margin-bottom: 2px;

    img {
      height: 100%;
      width: 100%;
    }
  }
}
</style>
